#include <stdlib.h>
#include <stdio.h>
#include "types.h"
#include "stack.h"

/// implements the registers and stack
/// hopefully this will work...


// WHAT WE NEED:
// stack of like a bunch of numbers, basically an array
// a register storing four values (currently), also ints
// seems pretty easy huh?



static int stackPush(stack_c* stack, int* value) {
	printf("pushed %d to stack\n", value);
	return 0;
}

static int stackFree(stack_c* stack) {
	free(stack->stack_array);
	stack->stack_array = NULL;
	stack->stack_used = 0;
	stack->stack_size = 0;

	return 0;
}

int stackInit(stack_c* stack) {
	stack->push = &stackPush;
	stack->free = &stackFree;

	stack->stack_array = (int *)malloc(5 * sizeof(int));
	stack->stack_used = 0;
	stack->stack_size = 5; // just starting at 5 because why not

	return 0;
}